#!/bin/bash

if [ "$DISABLE_DNS_RESOLVER" = true ]; then
  cp -f /etc/resolv.conf /var/mail/postfix/spool/etc/resolv.conf
  exit 0
fi

# Use the local DNS server
echo "nameserver 127.0.0.1" | tee /etc/resolv.conf \
                                  /var/mail/postfix/spool/etc/resolv.conf \
                                  >/dev/null

logger -p mail.info "s6-supervise : spawning unbound process"
exec unbound &> /dev/stdout
